<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>钉钉用户成员列表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../../../component/elementUI/index.css">
    <link rel="stylesheet" href="../../../style/index.css">
    <style>
        .mark {
            margin-right: 10px;
            color: #F56C6C;
            font-size: 16px;
            cursor: pointer;
        }

        .el-upload-dragger {
            width: 180px;
            height: 50px;
        }

        .el-upload-dragger .el-icon-upload {
            font-size: 33px;
            color: #C0C4CC;
            margin: 15px 0 8px;
            line-height: 12.5px;
        }

        .el-upload-dragger .el-upload__text {
            color: #606266;
            font-size: 8px;
            text-align: center;
        }
        .el-upload-list__item:first-child{
            margin-top: 0;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak class="minWidth">
        <el-card style="background-color: white;">
            <el-form :inline="true" :form="form">
                <el-form-item>
                    <el-button @click="window.history.back()">返回</el-button>
                </el-form-item>
                <el-form-item>
                    <el-button type="danger" :loading="loading" @click="batchRemove">批量删除</el-button>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="Add">添加</el-button>
                </el-form-item>
                <el-form-item>
                    <el-button type="success" @click="batchAdd">导入</el-button>
                </el-form-item>
                <el-form-item>
                    <el-input placeholder="请输入成员姓名" clearable @change="onSerach"
                        v-model.trim="form.Primary_Key"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="onSerach">查询</el-button>
                </el-form-item>
            </el-form>

            <el-table :data="tableData" stripe border style="width: 100%" height="calc(100vh - 200px)"
                @selection-change="handleSelectionChange">
                <el-table-column align="center" type="selection" width="40"></el-table-column>
                <el-table-column align="center" label="序号" width="50" type="index"></el-table-column>
                <el-table-column align="center" prop="User_ID" label="钉钉用户ID">
                    <template v-slot="{row}">
                        <div v-if="row.isEdit" style="display: flex; align-items: center;">
                            <el-tooltip class="item" effect="dark" content="该字段不能为空" placement="left">
                                <i v-show="!row.User_ID" class="el-icon-warning mark"></i>
                            </el-tooltip>
                            <el-input v-model="row.User_ID"></el-input>
                        </div>
                        <span v-else>{{row.User_ID}}</span>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="User_Name" label="用户昵称">
                    <template v-slot="{row}">
                        <div v-if="row.isEdit" style="display: flex; align-items: center;">
                            <el-tooltip class="item" effect="dark" content="该字段不能为空" placement="left">
                                <i v-show="!row.User_Name" class="el-icon-warning mark"></i>
                            </el-tooltip>
                            <el-input v-model="row.User_Name"></el-input>
                        </div>
                        <span v-else>{{row.User_Name}}</span>
                    </template>
                </el-table-column>
                <el-table-column align="center" label="操作" width="180">
                    <template v-slot="{row}">
                        <el-button :loading="row.loading" :type="row.isEdit?'success':'primary'" size="small"
                            @click="Edit(row)">{{row.isEdit?'保存':'编辑'}}</el-button>
                        <el-button type="danger" size="small" @click="Delete(row)">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <el-pagination style="margin-top: 5px;" background v-show="total > 0" @size-change="handleSizeChange"
                @current-change="handleCurrentChange" :current-page="form.page" :page-sizes="[10, 20, 30, 50]"
                :page-size="form.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
            </el-pagination>
            <add-form :visible.sync="dialogAdd" @success="addSuccess"></add-form>
            <batch-add-form :visible.sync="dialogBatchAdd" @success="addSuccess"></batch-add-form>
        </el-card>
    </div>
    <script type="text/javascript" src="../../../utils/jquery-3.6.0.min.js"></script>
    <script type="text/javascript" src="../../../utils/jquery.cookie.js"></script>
    <script type="text/javascript" src="../../../utils/vue.min.js"></script>
    <script type="text/javascript" src="../../../component/elementUI/index.js"></script>
    <script type="text/javascript" src="../../../utils/xlsx.full.min.js"></script>
    <script type="text/javascript" src="../../../utils/xlsx.core.min.js"></script>
    <script type="text/javascript" src="../../../utils/utils.js"></script>
    <script type="text/javascript" src="js/UserIDs.js"></script>
</body>

</html>